﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	x:Class="Guide.ThumbUC"
	x:Name="UserControl"
	Width="328" Height="431" xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:XMLTV="clr-namespace:Guide.XMLTV" xmlns:Guide="clr-namespace:Guide">

	<UserControl.Resources>
		<Style x:Key="ButtonFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle SnapsToDevicePixels="true" Margin="2" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#F3F3F3" Offset="0"/>
			<GradientStop Color="#EBEBEB" Offset="0.5"/>
			<GradientStop Color="#DDDDDD" Offset="0.5"/>
			<GradientStop Color="#CDCDCD" Offset="1"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
		<Style x:Key="BackButtonStyle" TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Border Margin="0,0,4,4" Background="#FF333333" CornerRadius="5,5,5,5" BorderThickness="1,1,1,1">
							<Border.BorderBrush>
								<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
									<GradientStop Color="#99000000" Offset="0"/>
									<GradientStop Color="#7ED0D0D0" Offset="1"/>
									<GradientStop Color="#99313131" Offset="0.956"/>
								</LinearGradientBrush>
							</Border.BorderBrush>
							<Border Width="Auto" Height="25.96" CornerRadius="5,5,5,5">
								<Border.Background>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#19FFFFFF" Offset="0"/>
										<GradientStop Color="#58FEFEFE" Offset="0.048"/>
										<GradientStop Color="#00FFFFFF" Offset="0.52"/>
										<GradientStop Color="#17FEFEFE" Offset="0.515"/>
									</LinearGradientBrush>
								</Border.Background>
								<Label Content="{TemplateBinding Content}" FontFamily="{TemplateBinding FontFamily}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FFFFFFFF" FontWeight="{TemplateBinding FontWeight}" FontStretch="Normal" FontSize="{TemplateBinding FontSize}" Margin="8,0,8,0"/>
							</Border>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true"/>
							<Trigger Property="ToggleButton.IsChecked" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="#ADADAD"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
			<Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="Padding" Value="2,0,0,0"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBoxItem}">
						<Border SnapsToDevicePixels="true" x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
							<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsSelected" Value="true"/>
							<MultiTrigger>
								<MultiTrigger.Conditions>
									<Condition Property="IsSelected" Value="true"/>
									<Condition Property="Selector.IsSelectionActive" Value="false"/>
								</MultiTrigger.Conditions>
							</MultiTrigger>
							<Trigger Property="IsEnabled" Value="false"/>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="CategoriesItemsStyles" TargetType="{x:Type ListBoxItem}">
			<Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="Padding" Value="2,0,0,0"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBoxItem}">
						<Border SnapsToDevicePixels="true" x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
							<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsSelected" Value="true"/>
							<MultiTrigger>
								<MultiTrigger.Conditions>
									<Condition Property="IsSelected" Value="true"/>
									<Condition Property="Selector.IsSelectionActive" Value="false"/>
								</MultiTrigger.Conditions>
							</MultiTrigger>
							<Trigger Property="IsEnabled" Value="false"/>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<DataTemplate x:Key="CategoriesTemplate">
			<Label Content="{Binding}" Padding="0,0,0,0" Foreground="#FF000000" FontFamily="Calibri"/>
		</DataTemplate>
		<SolidColorBrush x:Key="ListBorder" Color="#828790"/>
		<Style x:Key="CategoriesListBoxStyle1" TargetType="{x:Type ListBox}">
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBox}">
						<Border SnapsToDevicePixels="true" x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
							<ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}" x:Name="scrollViewer" Foreground="#FF000000">
								<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
							</ScrollViewer>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false"/>
							<Trigger Property="IsGrouping" Value="true">
								<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<DataTemplate x:Key="ChannelsTemplate">
			<StackPanel Width="330">
				<StackPanel.Background>
					<LinearGradientBrush EndPoint="0.5,0.011" StartPoint="0.5,0">
						<GradientStop Color="#FFC7C7C7" Offset="0"/>
						<GradientStop Color="#FFFFFFFF" Offset="1"/>
					</LinearGradientBrush>
				</StackPanel.Background>
				<Image Source="{Binding Path=IconUrl}" HorizontalAlignment="Left" Margin="12,10,0,0" Width="40" Height="40"/>
				<ItemsControl ItemsSource="{Binding Path=Programs}" Width="320" Margin="0,-31,0,0">
					<ItemsControl.ItemTemplate>
						<DataTemplate>
							<DataTemplate.Resources>
								<Storyboard x:Key="Highlight">
									<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="stackPanel" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
										<SplineColorKeyFrame KeyTime="00:00:00" Value="#001D97DC"/>
										<SplineColorKeyFrame KeyTime="00:00:00.3000000" Value="#331D97DC"/>
									</ColorAnimationUsingKeyFrames>
								</Storyboard>
								<Storyboard x:Key="OffLight">
									<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="stackPanel" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
										<SplineColorKeyFrame KeyTime="00:00:00.3000000" Value="#001D97DC"/>
									</ColorAnimationUsingKeyFrames>
								</Storyboard>
							</DataTemplate.Resources>
							<StackPanel Background="#001D97DC" x:Name="stackPanel" Cursor="Hand">
								<Grid Width="Auto" Height="Auto" Margin="35,0,0,0" Background="#00000000">
									<Label Content="{Binding Path=StartTimeShort, Mode=Default}" x:Name="_hour" Padding="0,2,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="19,0,0,0" Width="Auto" FontFamily="Calibri" FontSize="11" FontStyle="Italic" RenderTransformOrigin="0.587,0.877"/>
									<TextBlock Text="{Binding Path=Title}" FontFamily="Calibri" Padding="0,0,0,0" Margin="55,0,0,0" VerticalAlignment="Top" d:LayoutOverrides="Height" FontWeight="Bold" FontSize="14" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" x:Name="_title"/>
									<StackPanel VerticalAlignment="Bottom" Height="Auto" Margin="51,13,0,4" Orientation="Horizontal">
										<ListBox IsSynchronizedWithCurrentItem="True" ItemContainerStyle="{DynamicResource CategoriesItemsStyles}" ItemTemplate="{DynamicResource CategoriesTemplate}" ItemsSource="{Binding Path=Categories, Mode=Default}" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}" x:Name="_cats" Width="Auto" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" IsEnabled="False" Style="{DynamicResource CategoriesListBoxStyle1}"/>
										<Label Content="{Binding Path=LengthFormated, Mode=Default}" x:Name="_length" Padding="5,2,0,0" FontFamily="Calibri"/>
									</StackPanel>
								</Grid>
								<Rectangle Fill="{x:Null}" Stroke="#18000000"/>
							</StackPanel>
							<!--<DataTemplate.Triggers>
								<Trigger Property="IsMouseOver" Value="True">
									<Trigger.ExitActions>
                    <BeginStoryboard Storyboard="{StaticResource OffLight}" x:Name="OffLight_BeginStoryboard"/>
									</Trigger.ExitActions>
									<Trigger.EnterActions>
										<BeginStoryboard Storyboard="{StaticResource Highlight}"/>
									</Trigger.EnterActions>
								</Trigger>
							</DataTemplate.Triggers>-->
						</DataTemplate>
					</ItemsControl.ItemTemplate>
				</ItemsControl>
			</StackPanel>
		</DataTemplate>
		<ObjectDataProvider x:Key="GuideDS" d:IsDataSource="True" ObjectType="{x:Type XMLTV:Guide}"/>
		<Storyboard x:Key="ShowProgramDetails"/>
		<Storyboard x:Key="HideProgramDetails"/>
	</UserControl.Resources>
	<StackPanel Width="328" Height="461">
		<Border x:Name="_header" Height="45.349">
			<Border.Background>
				<LinearGradientBrush EndPoint="0.5,0.812" StartPoint="0.5,0">
					<GradientStop Color="#FFC5C5C5" Offset="0"/>
					<GradientStop Color="#FF000000" Offset="1"/>
					<GradientStop Color="#FF535353" Offset="0.036"/>
				</LinearGradientBrush>
			</Border.Background>
			<Grid Width="328" Height="45.349"/>
		</Border>
		<Border x:Name="_content" Height="338.44" Background="#FFFFFFFF" ClipToBounds="True">
			<StackPanel Width="Auto" Height="Auto" HorizontalAlignment="Left" Orientation="Horizontal"/>
		</Border>
		<Border x:Name="_footer" Height="45.349" Width="328">
			<Border.Background>
				<LinearGradientBrush EndPoint="0.5,0.812" StartPoint="0.5,0">
					<GradientStop Color="#FFC5C5C5" Offset="0"/>
					<GradientStop Color="#FF000000" Offset="1"/>
					<GradientStop Color="#FF535353" Offset="0.036"/>
				</LinearGradientBrush>
			</Border.Background>
			<StackPanel Orientation="Horizontal"/>
		</Border>
	</StackPanel>
</UserControl>